﻿using DoNetDrive.Core.Command;
using DoNetDrive.Protocol.Door.Door8800;
using DoNetDrive.Protocol.Fingerprint.SystemParameter.OEM;
using System;
using System.Collections.Generic;
using System.Text;

namespace DoNetDrive.Protocol.Fingerprint.SystemParameter.MasterSlaveMode
{
    /// <summary>
    /// 主机/从机模式写入
    /// </summary>
    public class WriteMasterSlaveMode : Door8800Command_WriteParameter
    {
        /// <summary>
        /// 主机/从机模式写入
        /// </summary>
        /// <param name="cd"></param>
        /// <param name="par"></param>
        public WriteMasterSlaveMode(INCommandDetail cd, WriteMasterSlaveMode_Parameter par) : base(cd, par)
        {
            par.CheckedParameter();
        }
        /// <summary>
        /// 创建数据包
        /// </summary>
        protected override void CreatePacket0()
        {
            WriteMasterSlaveMode_Parameter model = _Parameter as WriteMasterSlaveMode_Parameter;
            var buf = GetNewCmdDataBuf(1);
            model.GetBytes(buf);
            Packet(0x01, 0x1F, 0x00, (uint)buf.ReadableBytes, buf);
        }
    }
}
